<template>
  <div class="Admain"  :style="{margin:`100px,0,100px,0`,backgroundImage:`url(${img})`}">

    <div class="w3ls-headding">
      <span><h1>加入我们</h1></span>
    </div>
    <div class="agile-main">
      <div class="agile-left" :style="{backgroundImage:`url(${imgii})` }">

      </div>
      <div class="agile-right">
        <form action="#" method="post">
          <div class="agile-right-h2">
            <h2> join us</h2>
          </div>
          <div class="w3l-name">
            <span><i class="fa fa-user" aria-hidden="true"></i></span>
            <input type="text"  v-model="account.username" placeholder="账号" required=""/>
          </div>
          <div class="clear"></div>
          <div class="w3l-cpsw">
            <span><i class="fa fa-lock" aria-hidden="true"></i></span>
            <input type="password"  v-model="account.name" placeholder="昵称" required=""/>
          </div>
          <div class="clear"></div>
          <div class="w3l-email">
            <span><i class="fa fa-envelope" aria-hidden="true"></i></span>
            <input type="email"  v-model="account.email" placeholder="Email" required=""/>
          </div>
          <div class="clear"></div>
          <div class="w3l-psw">
            <span><i class="fa fa-lock" aria-hidden="true"></i></span>
            <input type="password"  v-model="account.password " placeholder="password" required=""/>
          </div>

          <div class="w3l-agree">
            <input type="checkbox" class="checkbox">
            <p>我同意服务条款</p>
          </div>
          <div class="clear"></div>

          <div class="w3l-submit">
            <el-button class="Sdas" type="primary" style="width:100%;" @click.native.prevent="handleZ" plain @click="open">注册</el-button>
          </div>
        </form>
        <p class="wthree-p">  如果已经拥有账号  </p>
        <div class="wthree-social">
          <a href="#"><i class="fa fa-facebook" aria-hidden="true" plain @click="open"></i> 前往登录>>> </a>

        </div>
      </div>
      <div class="clear"></div>
    </div>
  </div>
</template>

<script>
  // eslint-disable-next-line no-unused-vars
  import * as LoginUser from '../mock/data/user.js';
  // class NewPerson{
  //     constructor(username,pwd,email,name){
  //       this.username = username ;
  //       this.password = pwd;
  //       this.email = email;
  //       this.name = name;
  //     }
  //   }



  export default {
    data() {
      return {
        img:require('../assets/images/bg.jpg'),
        imgii:require('../assets/images/left1.jpg'),
        account: {
          name:'',
          email:'',
          username: '',
          pwd: ''
        },

        checked: true
      };
    },

    methods: {
      handleZ(){
        console.log(LoginUser.LoginUsers)
        // var arr = new NewPerson(this.account.username,this.account.pwd)
        LoginUser.LoginUsers.push({
          name:this.account.username,
          username:this.account.username,
          password:this.account.pwd,
          email:this.account.email,

        })
        this.$router.push({ path: '/home' });
      },
      open() {
        this.$notify({
          title: '提示',
          message: '注册成功',
          offset: 100
        });
      }
    }

  }



</script>


<style scoped>

  div form div input{
    margin-left: 5px;
  }
  .Admain{
    margin-top: -50px;
    height: 860px;
  }
  .w3ls-headding{

  }
  .w3ls-headding span {

    color: #f5bb06;
  }
  .w3ls-headding h1 {

    padding-top: 50px;
    font-size: 50px;
    font-weight: 500;
    text-align: center;
    text-transform: capitalize;
    letter-spacing: 2px;
    color: #fff;
    margin: 45px 0px;
    font-family: 'Exo 2', sans-serif;
  }
  .agile-left {
    flex: 1;
    background: no-repeat;
    background-size: cover;
    background-position: 50% 50%;
  }
  .agile-main {
    width: 60%;
    max-width: 860px;
    margin: auto;
    display: flex;
  }
  .agile-right {
    flex: 1;
    padding: 2em;
    background: rgba(15, 16, 15, 0.89);
  }
  .agile-right-h2 h2 {
    font-size: 25px;
    font-weight: 500;
    text-align: center;
    text-transform: capitalize;
    color: #fff;
    letter-spacing: 1px;
    font-family: 'Exo 2', sans-serif;
  }
  .w3l-name, .w3l-email, .w3l-psw, .w3l-cpsw {
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-transform: capitalize;
    width: 100%;
    margin: 15px 0px;
    padding: 10px 0px 10px 10px;
    letter-spacing: 1px;
    box-sizing: border-box;
    border: none;
    outline: none;
    background: #fff;
    color: #1b1a1a;
    font-family: 'PT Sans', sans-serif;
  }
  .w3l-name, .w3l-email, .w3l-psw, .w3l-cpsw {
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-transform: capitalize;
    width: 100%;
    margin: 15px 0px;
    padding: 10px 0px 10px 10px;
    letter-spacing: 1px;
    box-sizing: border-box;
    border: none;
    outline: none;
    background: #fff;
    color: #1b1a1a;
    font-family: 'PT Sans', sans-serif;
  }
  .agile-right span .fa {
    font-size: 15px;
    width: 7%;
    text-align: center;
    border-right: 1px solid #000;
    color: #d82a87;
  }
  .fa {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .w3l-name input[type="text"], .w3l-email input[type="email"], .w3l-psw input[type="password"], .w3l-cpsw input[type="password"] {
    letter-spacing: 2px;
    border: none;
    outline: none;
    width: 90%;
    font-family: 'PT Sans', sans-serif;
  }
  .w3l-name, .w3l-email, .w3l-psw, .w3l-cpsw {
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-transform: capitalize;
    width: 100%;
    margin: 15px 0px;
    padding: 10px 0px 10px 10px;
    letter-spacing: 1px;
    box-sizing: border-box;
    border: none;
    outline: none;
    background: #fff;
    color: #1b1a1a;
    font-family: 'PT Sans', sans-serif;
  }
  .w3l-agree {
    text-align: center;
  }
  .Sdas {
    font-size: 15px;
    font-weight: 500;
    text-transform: capitalize;
    padding: 8px;
    width: 60% !important;
    margin: 8px auto;
    letter-spacing: 2px;
    border: 1px solid #fff;
    border-radius: 2em;
    background: transparent;
    color: #fff;
    outline: none;
    cursor: pointer;
    display: block;
    font-family: 'PT Sans', sans-serif;
    -webkit-transition: 0.5s all;
    -moz-transition: 0.5s all;
    -o-transition: 0.5s all;
    -ms-transition: 0.5s all;
    transition: 0.5s all;
  }
  .wthree-p {
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    text-transform: capitalize;
    letter-spacing: 2px;
    position: relative;
    color: #fff;
    font-family: 'PT Sans', sans-serif;
  }
  .wthree-p:before {
    position: absolute;
    content: '';
    width: 65px;
    height: 2px;
    background: #d82a87;
    top: 49%;
    left: 10%;
  }
  .wthree-p:after {
    position: absolute;
    content: '';
    width: 65px;
    height: 2px;
    background: #d82a87;
    top: 49%;
    left: 74%;
  }
  .wthree-social a {
    font-size: 15px;
    font-weight: 500;
    padding: 8px 4px;
    width: 55% !important;
    margin: 18px auto;
    text-align: center;
    text-decoration: none;
    letter-spacing: 1px;
    border: none;
    border-radius: 2em;
    background: #3b5998;
    color: #fff;
    outline: none;
    cursor: pointer;
    display: block;
    font-family: 'PT Sans', sans-serif;
    -webkit-transition: 0.5s all;
    -moz-transition: 0.5s all;
    -o-transition: 0.5s all;
    -ms-transition: 0.5s all;
    transition: 0.5s all;
  }
  .w3l-agree {
    text-align: center;
  }
  .w3l-agree p {
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    display: inline-block;
    text-transform: capitalize;
    letter-spacing: 1px;
    color: #fff;
    font-family: 'PT Sans', sans-serif;
  }
</style>
